//PongGeometry.h

//Slightly modified from From GNUStep core NSGeometry.h

#import <UIKit/UIView-Rendering.h>
#import <UIKit/UIView-Geometry.h>

#import <Foundation/NSString.h>

/** Parses point from string of form "<code>{x=a; y=b}</code>". (0,0) returned
    if parsing fails. */
extern CGPoint	PongCGPointFromString(NSString* string);

/** Parses size from string of form "<code>{width=a; height=b}</code>". Size of
    0,0 returned if parsing fails. */
extern CGSize	PongCGSizeFromString(NSString* string);

/** Parses point from string of form "<code>{x=a; y=b; width=c;
    height=d}</code>".  Rectangle of 0 size at origin returned if parsing
    fails.
*/
extern CGRect	PongCGRectFromString(NSString* string);

// 
// BOOL PongCGIntersectsRect(NSRect aRect, NSRect bRect)
// {
//   /* Note that intersecting at a line or a point doesn't count */
//   return (NSMaxX(aRect) <= NSMinX(bRect)
//           || NSMaxX(bRect) <= NSMinX(aRect)
//               || NSMaxY(aRect) <= NSMinY(bRect)
//               || NSMaxY(bRect) <= NSMinY(aRect)) ? NO : YES;
// }

//conversions
extern NSPoint NSPointFromCGPoint(CGPoint thePoint);
extern CGPoint CGPointFromNSPoint(NSPoint thePoint);
extern NSRect NSRectFromCGRect(CGRect theRect);
extern CGRect CGRectFromNSRect(NSRect theRect);
